# @noautodeps
load("@prelude//utils:source_listing.bzl", "source_listing")
load(":defs.bzl", "apple_oso_scrubber_target")

oncall("build_infra")

source_listing()

apple_tools(
    name = "apple-tools",
    adhoc_codesign_tool = None, # @oss-enable
    # @oss-disable[end= ]: adhoc_codesign_tool = "prelude//apple/tools/meta_only/codesign_rust:adhoc-signer",
    assemble_bundle = "prelude//apple/tools/bundling:assemble_bundle",
    codesign_manifest_tree_postprocessor = "prelude//apple/tools/codesign_manifest_tree_postprocessor:codesign_manifest_tree_postprocessor",
    dry_codesign_tool = ":dry_codesign_tool",
    framework_sanitizer = ":framework_sanitizer",
    info_plist_processor = "prelude//apple/tools/info_plist_processor:tool",
    ipa_package_maker = ":ipa_package_maker",
    make_modulemap = ":make_modulemap",
    make_vfsoverlay = ":make_vfsoverlay",
    selective_debugging_scrubber = apple_oso_scrubber_target(),
    signing_context = "prelude//apple/tools/bundling:signing_context",
    signing_context_tree_postprocessor = "prelude//apple/tools/signing_context_tree_postprocessor:signing_context_tree_postprocessor",
    split_arch_combine_dsym_bundles_tool = ":split_arch_combine_dsym_bundles_tool",
    spm_packager = ":spm_packager",
    static_archive_linker = ":static_archive_linker",
    visibility = ["PUBLIC"],
    xcframework_maker = ":xcframework_maker",
)

python_binary(
    name = "framework_sanitizer",
    main = "framework_sanitizer.py",
    visibility = ["PUBLIC"],
)

python_binary(
    name = "xcframework_maker",
    main = "xcframework_maker.py",
    visibility = ["PUBLIC"],
)

python_binary(
    name = "dry_codesign_tool",
    main = "dry_codesign_tool.py",
    visibility = ["PUBLIC"],
)

python_binary(
    name = "ipa_package_maker",
    main = "ipa_package_maker.py",
    visibility = ["PUBLIC"],
    deps = [
        "prelude//apple/tools/re_compatibility_utils:re_compatibility_utils",
    ],
)

python_bootstrap_binary(
    name = "make_modulemap",
    main = "make_modulemap.py",
    visibility = ["PUBLIC"],
)

python_bootstrap_binary(
    name = "make_swift_comp_db",
    main = "make_swift_comp_db.py",
    visibility = ["PUBLIC"],
)

python_bootstrap_binary(
    name = "make_swift_interface",
    main = "make_swift_interface.py",
    visibility = ["PUBLIC"],
)

python_bootstrap_binary(
    name = "make_vfsoverlay",
    main = "make_vfsoverlay.py",
    visibility = ["PUBLIC"],
)

python_library(
    name = "plistlib_utils",
    srcs = ["plistlib_utils.py"],
    visibility = ["PUBLIC"],
)

python_binary(
    name = "split_arch_combine_dsym_bundles_tool",
    main = "split_arch_combine_dsym_bundles_tool.py",
    visibility = ["PUBLIC"],
)

python_bootstrap_binary(
    name = "swift_exec",
    has_content_based_path = True,
    main = "swift_exec.py",
    visibility = ["PUBLIC"],
    deps = ["prelude//apple/tools/re_compatibility_utils:bootstrap_re_compatibility_utils"],
)

python_binary(
    name = "static_archive_linker",
    main = "static_archive_linker.py",
    visibility = ["PUBLIC"],
)

python_binary(
    name = "spm_packager",
    main = "spm_packager.py",
    visibility = ["PUBLIC"],
)

export_file(
    name = "empty.c",
    visibility = ["PUBLIC"],
)
